package utility.file.writefile;

import java.io.*;

public class WriteUTF8 {
	public static void main(String[] args) throws IOException {

		try {
			BufferedWriter out = new BufferedWriter(new OutputStreamWriter(
					new FileOutputStream("C:\\var\\adptg\\marin\\2013-09-17\\ajava2.txt"), "UTF-8"));
			String s = new String( "12345");
			String utf8Str = new String(s.getBytes(), "UTF-8");

			out.write("\uFEFF");
			out.write(utf8Str);

			out.close();
			System.out.println("Written Process Completed");
		} catch (UnsupportedEncodingException ue) {
			System.out.println("Not supported : ");
		} catch (IOException e) {
			System.out.println(e.getMessage());
		}

	}
}
